package com.eling.elcms.travel.service;

import com.eling.elcms.core.dao.hibernate.search.SearchCondition;
import com.eling.elcms.core.service.IGenericManager;
import com.eling.elcms.core.webapp.controller.Msg;
import com.eling.elcms.member.model.Member;
import com.eling.elcms.travel.model.*;
import com.eling.elcms.travel.model.view.*;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.Date;
import java.util.List;

public interface ITravelContractManager extends IGenericManager<TravelContract, Long>  {

	TravelContract saveAll(TravelContract travelContract, Boolean isMem, Long pkLong);

	List<ProductBatch> queryProductBatch(TravelContract cond);

	Msg deleteAll(Long pkTravelContract);

	
	/**
	 * 获取合同对应的产品规则
	 * @param contract 合同
	 * @param type 规则类型
	 * @return 产品规则
	 */
	SettlementsRule getContractSetlRuleByType(TravelContract contract, RuleType type);
	
	/**
	 * 获取合同对应的产品规则范围
	 * @param contract 合同
	 * @param type 规则类型
	 * @return 产品规则范围
	 */
	List<RuleScope> getContractSetlRuleScopeByType(TravelContract contract, RuleType type);

	/**
	 * 合同签约搜索会员及客户
	 * @param sc
	 * @param tuView
	 * @return
	 * @author zhoulin
	 */
	List<TravelUserView> searchContractUser(SearchCondition sc, TravelUserView tuView);

	List<ContractStatView> countValid(Date signUpDate, Date signUpDateEnd);

	List<contractGridValid> contractValid(Long pkProduct, Long pkProductType, Date signUpDate, Date signUpDateEnd); 
	
	/**
	 * 查询闲置的会员证件
	 */
	List<TravelContractView> queryIdle(@ModelAttribute TravelContractView cond) throws Exception;

	ReturnCredentialsView queryByCard(TravelContract cond, Long pkReturnCredentials, Boolean flag);

	List<Member> pageQueryByPoint(Member cond, Long pkCommunityData, Long pkServicePoint, Long pkInterest,String pkOrg,Boolean exitMember);

	List<Member> searchMemPagingWithCard(SearchCondition sc,Member cond, Long pkCommunityData, Long pkServicePoint, Long pkInterest,String pkOrg,Boolean exitMember);

	ProductRuleDetail getProductDetail(TravelContract cond);

	TravelContractView searchByMemberCertificates(String memberCertificates);
}
